﻿/*
 *    Copyright © 2012 FPInst authors
 *
 *      This file is part of the FPInst project 
 *      (for more information, see: http://code.google.com/p/fpinst/).
 *
 *    FPInst is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU General Public License as published by
 *    the Free Software Foundation, either version 3 of the License, or
 *    (at your option) any later version.
 *
 *    FPInst is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU General Public License for more details.
 *
 *    You should have received a copy of the GNU General Public License
 *    along with FPInst.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SignalGen
{
    public class Device
    {
        public string DriverVersion;
        public string Manufacturer;
        public string Product;
        public string Serial;
        public string FirmwareVersion;
        public int FPGASampleNum = 2048;
        public int FPGAFreq = 25000;
        public byte FPGASampleResolution = 8;
        public byte FPGAAccResolution = 32;
        public byte FPGAPhaseResolution = 10;
        public byte FPGAFreqResolution = 30;
        public byte OffsetResolution = 12;
        public byte AmpResolution = 12;

        public UInt32 MaxFreq
        {
            get
            {
                return (UInt32)(1 << FPGAFreqResolution) - 1;
            }
        }

        public double MinStep
        {
            get
            {
                return (double)FPGAFreq / (1L << FPGAAccResolution);
            }
        }

        public int MaxOffset
        {
            get
            {
                return (1 << OffsetResolution) - 1;
            }
        }
    }
}
